/**
 * 
 */
package ptvv.system;


/**
 * @author 01
 * 
 */
public class ThreadAndClass {
	public DefPortAutomaton autoclass;
	public Thread autothread;

	public ThreadAndClass(DefPortAutomaton tempAutomata) {
		this.autoclass = tempAutomata;
		this.autothread = new Thread(tempAutomata);
		this.autothread.setName(tempAutomata.getName());
	}

	/**
	 * Thread is already instantiated
	 * 
	 * @param tempAutomata
	 * @param tempthread
	 */
	public ThreadAndClass(DefPortAutomaton tempAutomata, Thread tempthread) {
		this.autoclass = tempAutomata;
		this.autothread = tempthread;
		this.autothread.setName(tempAutomata.getName());
	}

	public void restartThread() {
		autoclass.internalState = InternalStates.Starting;
		autoclass.message = "";
		this.autothread = new Thread(autoclass);
		this.autothread.setName(autoclass.getName());

	}

}
